<template>
  <div class="grassAI-content-image">
    <el-image v-if="imgInfo.url" style="width: 80px; height: 80px; border-radius: 6px" :src="imgInfo.url"
      :preview-src-list="[imgInfo.url]">
    </el-image>

    <GText v-if="imgInfo.content" :content="imgInfo.content" />
  </div>
</template>
  
<script>
export default {
  props: {
    content: String,
  },
  components: {
    GText: () => import("./text.vue"),
  },
  data() {
    return {
      imgList: [],
      imgInfo: {},
    }
  },

  watch: {
    content: {
      handler(val) {
        if (!val) return;
        this.imgInfo = JSON.parse(val);
      },
      immediate: true,
    }
  },
};
</script>
  
<style lang="scss" scoped>
.grassAI-content-image {
  width: 100%;
}
</style>